/**
* 查看流程模型
 */
<template>
    <vp-dialog ref="dialogRef">    
        <template #title><vp-label zh="流程模型" en="Modeler" align="left"/></template>
            <ViewModelerCanvas ref="modelerCanvasRef" @form-submited="handleFormSubmited" :id="bpmn.id" :name="bpmn.name" :style="`height:calc(100vh - 250px)`"></ViewModelerCanvas>
        <template #footer>
        </template>
    </vp-dialog>
</template>

<script lang="ts" setup name="EditWorkflowmodel">
import { defineExpose, ref } from 'vue';

import ViewModelerCanvas from './ViewModelerCanvas.vue';

const emits = defineEmits<{
    (e: 'formSubmited'): void
}>()

const dialogRef = ref();

//模型信息
const bpmn = ref<{
    id: string,
    name: string,
}>({
    id: "",
    name: ""
})

const modelerCanvasRef = ref();

const handleOpen = (id: string, name: string)=>{
    bpmn.value = {
        id: id,
        name: name,
    }
    dialogRef.value.handleOpen()
}

//保存模型后事件
const handleFormSubmited = ()=>{ 
    emits('formSubmited')
    dialogRef.value.handleClose()
}

defineExpose({
    handleOpen
})
</script>
<style scoped lang="scss">

</style>
